home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / tclX6.4c / dist / tclsrc / RCS / installTcl.tcl,v < prev   
Encoding:
Text File  |  1992-12-03  |  20.0 KB  |  645 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    jhh:1.1; strict;
  6. comment  @@;
  7.  
  8.  
  9. 1.1
  10. date     92.12.03.15.56.58;  author jhh;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @#
  26. # installTcl.tcl -- 
  27. #
  28. # Tcl program to install Tcl onto the system.
  29. #
  30. #------------------------------------------------------------------------------
  31. # Copyright 1992 Karl Lehenbauer and Mark Diekhans.
  32. #
  33. # Permission to use, copy, modify, and distribute this software and its
  34. # documentation for any purpose and without fee is hereby granted, provided
  35. # that the above copyright notice appear in all copies.  Karl Lehenbauer and
  36. # Mark Diekhans make no representations about the suitability of this
  37. # software for any purpose.  It is provided "as is" without express or
  38. # implied warranty.
  39. #------------------------------------------------------------------------------
  40. # $Id: installTcl.tcl,v 1.1 1992/12/02 18:45:08 dglo Exp dglo $
  41. #------------------------------------------------------------------------------
  42. #
  43. # It is run in the following manner:
  44. #
  45. #     tcl installTcl.tcl
  46. #
  47. # This script reads the Extended Tcl Makefile confiugation file (Config.mk)
  48. # and converts the Makefile macros in Tcl variables that control the
  49. # installation.  The following variables are currently used:
  50. #
  51. #   TCL_UCB_DIR             TCL_DEFAULT             TCL_OWNER
  52. #   TCL_GROUP               TCL_BINDIR              TCL_LIBDIR
  53. #   TCL_INCLUDEDIR          TCL_TCLDIR              TCL_MAN_INSTALL
  54. #   TCL_MAN_BASEDIR         TCL_MAN_CMD_SECTION     TCL_MAN_FUNC_SECTION
  55. #   TK_MAN_CMD_SECTION      TK_MAN_FUNC_SECTION     TCL_MAN_STYLE*
  56. #   TCL_MAN_INDEX*          TCL_TK_SHELL*
  57. #
  58. # (ones marked with * are optional)
  59. #
  60. # Notes:
  61. #   o Must be run in the Extended Tcl top level directory.
  62. #   o The routine InstallManPages has code to determine if a manual page
  63. #     belongs to a command or function.  For Tcl the commands are assumed
  64. #     to be in "Tcl.man",  for TclX functions are in TclX.man.  All others
  65. #     are assumed to be functions.  For Tk, all manuals starting with Tk_
  66. #     are assumed to be functions, all others are assumed to be commands.
  67. #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  68.  
  69. #------------------------------------------------------------------------------
  70. # ParseConfigFile --
  71. #
  72. #  Parse a configure file in the current directory and convert all make
  73. #  macros to global Tcl variables.
  74.  
  75. proc ParseConfigFile {configFile} {
  76.    set cfgFH [open $configFile]
  77.  
  78.    while {[gets $cfgFH line] >= 0} {
  79.       if {[string match {[A-Za-z]*} $line]} {
  80.           set idx [string first "=" $line]
  81.           if {$idx < 0} {
  82.               error "no `=' in: $line"}
  83.           set name  [string trim [csubstr $line 0 $idx]]
  84.           set value [string trim [crange  $line [expr $idx+1] end]]
  85.           global $name
  86.           set $name $value
  87.       }
  88.    }
  89.    close $cfgFH
  90.  
  91. }
  92.  
  93. #------------------------------------------------------------------------------
  94. # GiveAwayFile --
  95. #   Give away a file to the Tcl owner and group and set its permissions.
  96. #
  97. # Globals:
  98. #    TCL_OWNER - Owner name for Tcl files.
  99. #    TCL_GROUP - Group nmae for Tcl file.
  100. #------------------------------------------------------------------------------
  101.  
  102. proc GiveAwayFile {file} {
  103.     global TCL_OWNER TCL_GROUP
  104.  
  105.     if {[file isdirectory $file]} {
  106.         chmod a+rx,go-w $file
  107.     } else {
  108.         chmod a+r,go-w $file
  109.     }    
  110.     chown [list $TCL_OWNER $TCL_GROUP] $file
  111.  
  112. } ;# GiveAwayFile
  113.  
  114. #------------------------------------------------------------------------------
  115. # MakePath --
  116. #
  117. # Make sure all directories in a directory path exists, if not, create them.
  118. #------------------------------------------------------------------------------
  119. proc MakePath {pathlist} {
  120.     foreach path $pathlist {
  121.         set exploded_path [split $path /]
  122.         set thisdir {}
  123.         foreach element $exploded_path {
  124.             append thisdir $element
  125.             if {![file isdirectory $thisdir]} {
  126.                 mkdir $thisdir
  127.                 GiveAwayFile $thisdir
  128.             }
  129.             append thisdir /
  130.         }
  131.     }
  132. }
  133.  
  134. #------------------------------------------------------------------------------
  135. # CopyFile -- 
  136. #
  137. # Copy the specified file and change the ownership.  If target is a directory,
  138. # then the file is copied to it, otherwise target is a new file name.
  139. #------------------------------------------------------------------------------
  140.  
  141. proc CopyFile {sourceFile target} {
  142.  
  143.     if {[file isdirectory $target]} {
  144.         set targetFile "$target/[file tail $sourceFile]"
  145.     } else {
  146.         set targetFile $target
  147.     }
  148.  
  149.     unlink -nocomplain $targetFile
  150.     set sourceFH [open $sourceFile r]
  151.     set targetFH [open $targetFile w]
  152.     copyfile $sourceFH $targetFH
  153.     close $sourceFH
  154.     close $targetFH
  155.     GiveAwayFile $targetFile
  156.  
  157. } ;# CopyFile
  158.  
  159. #------------------------------------------------------------------------------
  160. # CopyManPage -- 
  161. #
  162. # Copy the specified manual page and change the ownership.  The manual page
  163. # is edited to remove change bars (.VS and .VE macros). If target is a
  164. # directory, then the file is copied to it, otherwise target is a new file
  165. # name.
  166. #------------------------------------------------------------------------------
  167.  
  168. proc CopyManPage {sourceFile target} {
  169.  
  170.     if {[file isdirectory $target]} {
  171.         set targetFile "$target/[file tail $sourceFile]"
  172.     } else {
  173.         set targetFile $target
  174.     }
  175.  
  176.     unlink -nocomplain $targetFile
  177.     set sourceFH [open $sourceFile r]
  178.     set targetFH [open $targetFile w]
  179.     while {[gets $sourceFH line] >= 0} {
  180.         if [string match {.V[SE]*} $line] continue
  181.         puts $targetFH $line
  182.     }
  183.     close $sourceFH
  184.     close $targetFH
  185.     GiveAwayFile $targetFile
  186.  
  187. } ;# CopyManPage
  188.  
  189. #------------------------------------------------------------------------------
  190. # CopySubDir --
  191. #
  192. # Recursively copy part of a directory tree, changing ownership and 
  193. # permissions.  This is a utility routine that actually does the copying.
  194. #------------------------------------------------------------------------------
  195.  
  196. proc CopySubDir {sourceDir destDir} {
  197.     foreach sourceFile [glob -nocomplain $sourceDir/*] {
  198.  
  199.         if [file isdirectory $sourceFile] {
  200.             set destFile $destDir/[file tail $sourceFile]
  201.             if {![file exists $destFile]} {
  202.                 mkdir $destFile}
  203.             GiveAwayFile $destFile
  204.             CopySubDir $sourceFile $destFile
  205.         } else {
  206.             CopyFile $sourceFile $destDir
  207.         }
  208.     }
  209. } ;# CopySubDir
  210.  
  211. #------------------------------------------------------------------------------
  212. # CopyDir --
  213. #
  214. # Recurisvely copy a directory tree.
  215. #------------------------------------------------------------------------------
  216.  
  217. proc CopyDir {sourceDir destDir} {
  218.  
  219.     set cwd [pwd]
  220.     if ![file exists $sourceDir] {
  221.         error "\"$sourceDir\" does not exist"
  222.     }
  223.     if ![file isdirectory $sourceDir] {
  224.         error "\"$sourceDir\" isn't a directory"
  225.     }
  226.     if {![file exists $destDir]} {
  227.         mkdir $destDir
  228.         GiveAwayFile $destDir
  229.     }
  230.     if ![file isdirectory $destDir] {
  231.         error "\"$destDir\" isn't a directory"
  232.     }
  233.     cd $sourceDir
  234.     set status [catch {CopySubDir . $destDir} msg]
  235.     cd $cwd
  236.     if {$status != 0} {
  237.         global errorInfo errorCode
  238.         error $msg $errorInfo $errorCode
  239.     }
  240. }
  241.  
  242. #------------------------------------------------------------------------------
  243. # GenDefaultFile -- 
  244. #
  245. # Generate the tcl defaults file.
  246. #------------------------------------------------------------------------------
  247.  
  248. proc GenDefaultFile {defaultFileBase sourceDir} {
  249.  
  250.     set defaultFile "$defaultFileBase[infox version]"
  251.  
  252.     if ![file writable [file dirname $defaultFile]] {
  253.         puts stderr "Can't create $defaultFile -- directory is not writable"
  254.         puts stderr "Please reinstall with correct permissions or rebuild"
  255.         puts stderr "Tcl to select a default file where the directory path"
  256.         puts stderr "you specify is writable by you."
  257.         puts stderr ""
  258.         exit 1
  259.     }
  260.  
  261.     set fp [open $defaultFile w]
  262.  
  263.     puts $fp "# Extended Tcl [infox version] default file"
  264.     puts $fp ""
  265.     puts $fp "set TCLINIT $sourceDir/TclInit.tcl"
  266.     puts $fp ""
  267.     puts $fp "set TCLPATH $sourceDir"
  268.  
  269.     close $fp
  270.     GiveAwayFile $defaultFile
  271.  
  272. } ;# GenDefaultFile
  273.  
  274. #------------------------------------------------------------------------------
  275. # GetManNames --
  276. #
  277. #   Search a manual page (nroff source) for the name line.  Parse the name
  278. # line into all of the functions or commands that it references.  This isn't
  279. # comprehensive, but it works for all of the Tcl, TclX and Tk man pages.
  280. #
  281. # Parameters:
  282. #   o manFile (I) - The path to the  manual page file.
  283. # Returns:
  284. #   A list contain the functions or commands or {} if the name line can't be
  285. # found or parsed.
  286. #------------------------------------------------------------------------------
  287.  
  288. proc GetManNames {manFile} {
  289.  
  290.    set manFH [open $manFile]
  291.  
  292.    #
  293.    # Search for name line.  Once found, grab the next line that is not a
  294.    # nroff macro.  If we end up with a blank line, we didn't find it.
  295.    #
  296.    while {[gets $manFH line] >= 0} {
  297.        if [regexp {^.SH NAME.*$} $line] {
  298.            break
  299.        }
  300.    }
  301.    while {[gets $manFH line] >= 0} {
  302.        if {![string match ".*" $line]} break
  303.    }
  304.    close $manFH
  305.  
  306.    set line [string trim $line]
  307.    if {$line == ""} return
  308.  
  309.    #
  310.    # Lets try and parse the name list out of the line
  311.    #
  312.    if {![regexp {^(.*)(\\-)} $line {} namePart]} {
  313.        if {![regexp {^(.*)(-)} $line {} namePart]} return
  314.    }
  315.  
  316.    #
  317.    # This magic converts the name line into a list
  318.    #
  319.  
  320.    if {[catch {join [split $namePart ,] " "} namePart] != 0} return
  321.  
  322.    return $namePart
  323.  
  324. }
  325.  
  326. #------------------------------------------------------------------------------
  327. # SetUpManIndex --
  328. #   Setup generation of manual page index for short manual pages, if required.
  329. # Globals:
  330. #   o TCL_MAN_INDEX - Boolean indicating if a manual page is to be created.
  331. #     If it does not exists, false is assumed.
  332. #   o TCL_MAN_BASEDIR - Base manual directory where all of the man.* and cat.* 
  333. #     directories live.
  334. # Returns:
  335. #   The manual index file handle, or {} if the manual index is not to be
  336. #  generated.
  337. #------------------------------------------------------------------------------
  338.  
  339. proc SetUpManIndex {} {
  340.     global TCL_MAN_BASEDIR TCL_MAN_INDEX
  341.  
  342.     if {!([info exists TCL_MAN_INDEX] && [set TCL_MAN_INDEX])} {
  343.         return {}
  344.     }
  345.     set tclIndexFile $TCL_MAN_BASEDIR/index.TCL
  346.     return [open $tclIndexFile w]
  347. }
  348.  
  349. #------------------------------------------------------------------------------
  350. # FinishUpManIndex --
  351. #   Finish generation of manual page index for short manual pages, if required.
  352. # Parameters:
  353. #   o indexFileHdl - The file handle returned by SetUpManIndex, maybe {}.
  354. # Globals:
  355. #   o TCL_MAN_BASEDIR - Base manual directory where all of the man.* and cat.* 
  356. #     directories live.
  357. #------------------------------------------------------------------------------
  358.  
  359. proc FinishUpManIndex {indexFileHdl} {
  360.     global TCL_MAN_BASEDIR TCL_MAN_INDEX_MERGE
  361.  
  362.     if [lempty $indexFileHdl] return
  363.  
  364.     set tclIndexFile $TCL_MAN_BASEDIR/index.TCL
  365.     close $indexFileHdl
  366.     GiveAwayFile $tclIndexFile
  367.  
  368. }
  369.  
  370. #------------------------------------------------------------------------------
  371. # InstallShortMan --
  372. #   Install a manual page on a system that does not have long file names,
  373. #   optionally adding an entry to the man index.
  374. #
  375. # Parameters:
  376. #   o sourceFile - Manual page source file path.
  377. #   o section - Section to install the manual page in.
  378. #   o indexFileHdl - File handle of the current index file being created, or
  379. #     empty if no index is to be created.
  380. # Globals:
  381. #   o TCL_MAN_BASEDIR - Base manual directory where all of the man.* and cat.* 
  382. #     directories live.
  383. #   o TCL_MAN_SEPARATOR - The name separator between the directory and the
  384. #     section.
  385. #------------------------------------------------------------------------------
  386.  
  387. proc InstallShortMan {sourceFile section indexFileHdl} {
  388.     global TCL_MAN_BASEDIR TCL_MAN_SEPARATOR
  389.  
  390.     set manNames [GetManNames $sourceFile]
  391.     if [lempty $manNames] {
  392.         set baseName [file tail [file root $sourceFile]]
  393.         puts stderr "Warning: can't parse NAME line for man page: $sourceFile."
  394.         puts stderr "         Manual page only available as: $baseName"
  395.     }
  396.  
  397.     set manFileBase [file tail [file root $sourceFile]]
  398.     set manFileName "$manFileBase.$section"
  399.  
  400.     set destManDir "$TCL_MAN_BASEDIR/man$TCL_MAN_SEPARATOR$section"
  401.     set destCatDir "$TCL_MAN_BASEDIR/cat$TCL_MAN_SEPARATOR$section"
  402.  
  403.     CopyManPage $sourceFile "$destManDir/$manFileName"
  404.     unlink -nocomplain  "$destCatDir/$manFileName"
  405.  
  406.     if {![lempty $indexFileHdl]} {
  407.         foreach name $manNames {
  408.             puts $indexFileHdl "$name\t$manFileBase\t$section"
  409.         }
  410.     }    
  411. }
  412.  
  413. #------------------------------------------------------------------------------
  414. # InstallLongMan --
  415. #   Install a manual page on a system that does have long file names.
  416. #
  417. # Parameters:
  418. #   o sourceFile - Manual page source file path.
  419. #   o section - Section to install the manual page in.
  420. # Globals:
  421. #   o TCL_MAN_BASEDIR - Base manual directory where all of the man.* and cat.* 
  422. #     directories live.
  423. #   o TCL_MAN_SEPARATOR - The name separator between the directory and the
  424. #     section.
  425. #------------------------------------------------------------------------------
  426.  
  427. proc InstallLongMan {sourceFile section} {
  428.     global TCL_MAN_BASEDIR TCL_MAN_SEPARATOR
  429.  
  430.     set manNames [GetManNames $sourceFile]
  431.     if [lempty $manNames] {
  432.         set baseName [file tail [file root $sourceFile]]
  433.         puts stderr "Warning: can't parse NAME line for man page: $sourceFile."
  434.         puts stderr "         Manual page only available as: $baseName"
  435.         set manNames $baseName
  436.     }
  437.  
  438.     set destManDir "$TCL_MAN_BASEDIR/man$TCL_MAN_SEPARATOR$section"
  439.     set destCatDir "$TCL_MAN_BASEDIR/cat$TCL_MAN_SEPARATOR$section"
  440.  
  441.     # Copy file to the first name in the list.
  442.  
  443.     set firstFile [lvarpop manNames]
  444.     set firstFilePath "$destManDir/$firstFile.$section"
  445.  
  446.     CopyManPage $sourceFile $firstFilePath
  447.     unlink -nocomplain   "$destCatDir/$firstFile.$section"
  448.  
  449.     # Link it to the rest of the names in the list.
  450.  
  451.     foreach manEntry $manNames {
  452.         set destFilePath "$destManDir/$manEntry.$section"
  453.         unlink -nocomplain  $destFilePath
  454.         if {[catch {
  455.                 link $firstFilePath $destFilePath
  456.             } msg] != 0} {
  457.             puts stderr "error from: link $firstFilePath $destFilePath"
  458.             puts stderr "    $msg"
  459.         }
  460.         unlink -nocomplain "$destCatDir/$manEntry.$section"
  461.     }
  462.  
  463. }
  464.  
  465. #------------------------------------------------------------------------------
  466. # InstallManPage --
  467. #   Install a manual page on a system.
  468. #
  469. # Parameters:
  470. #   o sourceFile - Manual page source file path.
  471. #   o section - Section to install the manual page in.
  472. #   o indexFileHdl - File handle of the current index file being created, or
  473. #     empty if no index is to be created.
  474. # Globals
  475. #   o TCL_MAN_STYLE - SHORT if short manual page names are being used,
  476. #     LONG if long manual pages are being used.
  477. #------------------------------------------------------------------------------
  478.  
  479. proc InstallManPage {sourceFile section indexFileHdl} {
  480.     global TCL_MAN_STYLE
  481.  
  482.     if {"$TCL_MAN_STYLE" == "SHORT"} {
  483.         InstallShortMan $sourceFile $section $indexFileHdl
  484.     } else {
  485.         InstallLongMan $sourceFile $section
  486.     }
  487. }
  488.  
  489. #------------------------------------------------------------------------------
  490. # InstallManPages --
  491. #   Install the manual pages.
  492. #------------------------------------------------------------------------------
  493.  
  494. proc InstallManPages {} {
  495.     global TCL_UCB_DIR          TCL_TK_SHELL         TCL_TK_DIR
  496.     global TCL_MAN_BASEDIR      TCL_MAN_SEPARATOR    TCL_MAN_STYLE
  497.     global TCL_MAN_CMD_SECTION  TCL_MAN_FUNC_SECTION
  498.     global TK_MAN_CMD_SECTION   TK_MAN_FUNC_SECTION
  499.  
  500.     if {![info exists TCL_MAN_STYLE]} {
  501.         set TCL_MAN_STYLE LONG
  502.     }
  503.     set TCL_MAN_STYLE [string toupper $TCL_MAN_STYLE]
  504.     case $TCL_MAN_STYLE in {
  505.         {SHORT} {}
  506.         {LONG}  {}
  507.         default {error "invalid value for TCL_MAN_STYLE: `$TCL_MAN_STYLE'"}
  508.     }
  509.  
  510.     MakePath $TCL_MAN_BASEDIR 
  511.     MakePath "$TCL_MAN_BASEDIR/man$TCL_MAN_SEPARATOR$TCL_MAN_CMD_SECTION"
  512.     MakePath "$TCL_MAN_BASEDIR/cat$TCL_MAN_SEPARATOR$TCL_MAN_CMD_SECTION"
  513.     MakePath "$TCL_MAN_BASEDIR/man$TCL_MAN_SEPARATOR$TCL_MAN_FUNC_SECTION"
  514.     MakePath "$TCL_MAN_BASEDIR/cat$TCL_MAN_SEPARATOR$TCL_MAN_FUNC_SECTION"
  515.  
  516.     set indexFileHdl [SetUpManIndex]
  517.  
  518.     # Install all of the actual files.
  519.  
  520.     echo "    Installing Tcl [info tclversion] man files"
  521.     foreach fileName [glob $TCL_UCB_DIR/doc/*.man] {
  522.         if {[file root $fileName] == "Tcl.man"} {
  523.             set section $TCL_MAN_CMD_SECTION
  524.         } else {
  525.             set section $TCL_MAN_FUNC_SECTION
  526.         }
  527.         InstallManPage $fileName $section $indexFileHdl
  528.     }
  529.  
  530.     echo "    Installing Extended Tcl [infox version] man files"
  531.  
  532.     foreach fileName [glob man/*.man] {
  533.         if {[file root $fileName] == "TclX.man"} {
  534.             set section $TCL_MAN_CMD_SECTION
  535.         } else {
  536.             set section $TCL_MAN_FUNC_SECTION
  537.         }
  538.         InstallManPage $fileName $section $indexFileHdl
  539.     }
  540.  
  541.     if {![info exists TCL_TK_SHELL]} {
  542.         FinishUpManIndex $indexFileHdl
  543.         return
  544.     }
  545.  
  546.     MakePath "$TCL_MAN_BASEDIR/man$TCL_MAN_SEPARATOR$TK_MAN_CMD_SECTION"
  547.     MakePath "$TCL_MAN_BASEDIR/cat$TCL_MAN_SEPARATOR$TK_MAN_CMD_SECTION"
  548.     MakePath "$TCL_MAN_BASEDIR/man$TCL_MAN_SEPARATOR$TK_MAN_FUNC_SECTION"
  549.     MakePath "$TCL_MAN_BASEDIR/cat$TCL_MAN_SEPARATOR$TK_MAN_FUNC_SECTION"
  550.  
  551.     echo "    Installing Tk man files"
  552.  
  553.     foreach fileName [glob $TCL_TK_DIR/doc/*.man] {
  554.         if {![string match "Tk_*" [file root $fileName]]} {
  555.             set section $TK_MAN_CMD_SECTION
  556.         } else {
  557.             set section $TK_MAN_FUNC_SECTION
  558.         }
  559.         InstallManPage $fileName $section $indexFileHdl
  560.     }
  561.  
  562.     FinishUpManIndex $indexFileHdl
  563.  
  564. } ;# InstallLongManPages
  565.  
  566. #------------------------------------------------------------------------------
  567. # Main program code.
  568. #------------------------------------------------------------------------------
  569.  
  570. echo ""
  571. echo ">>> Installing Extended Tcl [infox version] <<<"
  572.  
  573. set argc [llength $argv]
  574. if {$argc != 0} {
  575.     puts stderr "usage: tcl installTcl.tcl"
  576.     exit 1
  577. }
  578.  
  579. #
  580. # Bring in all of the macros defined bu the configuration file.
  581. #
  582. ParseConfigFile Config.mk
  583. ParseConfigFile config/$TCL_CONFIG_FILE
  584.  
  585. #
  586. # Make sure all directories exists that we will be installing in.
  587. #
  588.  
  589. MakePath [list $TCL_TCLDIR [file dirname $TCL_DEFAULT] $TCL_BINDIR]
  590. MakePath [list $TCL_LIBDIR $TCL_INCLUDEDIR $TCL_TCLDIR]
  591.  
  592. echo "    Creating default file: $TCL_DEFAULT[infox version]"
  593. GenDefaultFile $TCL_DEFAULT $TCL_TCLDIR
  594.  
  595. echo "    Installing `$TCL_SHELL' program in: $TCL_BINDIR"
  596. CopyFile tcl $TCL_BINDIR/$TCL_SHELL
  597. chmod +rx $TCL_BINDIR/$TCL_SHELL
  598.  
  599. echo "    Installing `libtclX.a' library in: $TCL_LIBDIR"
  600. CopyFile libtcl.a $TCL_LIBDIR/libtclX.a
  601.  
  602. echo "    Installing Tcl .h files in: $TCL_INCLUDEDIR"
  603. CopyFile $TCL_UCB_DIR/tcl.h $TCL_INCLUDEDIR
  604. CopyFile $TCL_UCB_DIR/tclHash.h $TCL_INCLUDEDIR
  605. CopyFile src/tclExtend.h $TCL_INCLUDEDIR
  606. CopyFile src/tcl++.h $TCL_INCLUDEDIR
  607.  
  608. echo "    Installing Tcl run-time files in: $TCL_TCLDIR"
  609. foreach srcFile [glob tcllib/*] {
  610.     if {![file isdirectory $srcFile]} {
  611.         CopyFile $srcFile $TCL_TCLDIR
  612.     }
  613. }
  614.  
  615. echo "    Installing Tcl help files in: $TCL_TCLDIR/help"
  616. if [file exists $TCL_TCLDIR/help] {
  617.      echo "       Purging old help tree"
  618.      exec rm -rf $TCL_TCLDIR/help
  619. }
  620. CopyDir tcllib/help          $TCL_TCLDIR/help
  621.  
  622. if [info exists TCL_TK_SHELL] {
  623.     echo "    Installing `$TCL_TK_SHELL' program in: $TCL_BINDIR"
  624.     CopyFile $TCL_TK_SHELL $TCL_BINDIR
  625.     chmod +rx $TCL_BINDIR/$TCL_TK_SHELL
  626.  
  627.     echo "    Installing `libtkX.a' library in: $TCL_LIBDIR"
  628.     CopyFile libtk.a $TCL_LIBDIR/libtkX.a
  629.  
  630.     echo "    Installing `tk.h' in: $TCL_INCLUDEDIR"
  631.     CopyFile $TCL_TK_DIR/tk.h $TCL_INCLUDEDIR/tkX.h
  632. }
  633.  
  634. foreach file [glob $TCL_TCLDIR/*.tlib] {
  635.     buildpackageindex $file
  636. }
  637.  
  638. if {$TCL_MAN_INSTALL} {
  639.     InstallManPages
  640. }
  641.  
  642. echo "     *** TCL IS NOW INSTALLED ***"
  643.  
  644. @
  645.